package cn.enited.devtools.apiaggregator.consts;

public enum ErrorCode {

    SUCCESS(200, "成功"),

    ERROR(500, "程序异常"),
    NULL(501, "数据为空"),
    MESSING_PARAM(502, "缺少参数"),
    WRONG_PARAM(503, "参数错误"),
    NOT_EXIST(504, "数据不存在"),
    EXIST(505, "数据已存在"),
    IN_USE(506, "数据已被使用"),
    INVALID_DATA(507, "无效数据"),
    INVALID_OPER(508, "无效操作"),
    OVER_SIZE(509, "文件大小超过限制"),
    DENY(600, "操作被拒绝"),
    WARNING(601, "警告，此操作需确认"),

    NO_AUTH(900, "身份认证失败"),
    NO_PREM(901, "您没有此操作的权限"),
    DISABLED(902, "帐号已冻结"),
    SESSION_TIMEOUT(903, "登录超时，请重新登录"),
    NOT_IMPLEMENT(999, "方法未实现");

    private int code;
    private String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }
}
